import request from '@/utils/request';

// 新增
export function addMenu(data) {
  return request({
    url: '/api/menu',
    method: 'post',
    data,
  });
}
// 菜单列表
export function getMenuList(data) {
  return request({
    url: '/api/menu',
    method: 'get',
    params: data,
  });
}

// 菜单修改
export function editMenu(data) {
  return request({
    url: '/api/menu',
    method: 'put',
    data,


  });
}

// 菜单删除
export function delByMenuId(id) {
  // console.log(params);
  return request({
    url: '/api/menu/' + id,
    method: 'DELETE',
  });
}

// 获取左侧菜单栏内容
export function getRoutes() {
  return request({
    url: '/api/menu/getRouters',
    method: 'get',
  });
}


export default {
  addMenu,
  getMenuList,
  editMenu,
  delByMenuId,
  getRoutes,
};
